<?php


namespace app\mall\model\System;


use think\facade\Db;
use think\Model;

class SysSettingModel extends Model
{

    /**
     * 数据表名
     * @var string
     */
    protected $name = "sys_setting";

    /**
     * @param $where
     * @return mixed
     * @throws
     */
    public static function getSysSettingWhere($where)
    {
        $setting = Db::name('sys_setting')->where($where)->find();
        return $setting;
    }

    /**
     * 添加返回ID
     * @param $data
     * @return int
     */
    public static function addSysSetting($data)
    {
        $id = Db::name('sys_setting')->insertGetId($data);
        return $id;
    }

    /**
     * 更新
     * @param $where
     * @param $save
     * @return int
     * @throws
     */
    public static function updateSysSettingWhere($where,$save)
    {
        $flag = Db::name('sys_setting')->where($where)->update($save);
        return $flag;
    }

}
